<template>   
  <el-table :data="logData" border style="width: 100%">
    <el-table-column prop="username" label="登录账户" width="180" />
    <el-table-column prop="lastLogin.ip" label="上次登录ip" width="180" />
    <el-table-column prop="lastLogin.loginTime" sortable label="上次登录时间" />
    <el-table-column prop="nowLogin.ip" label="本次登录ip" width="180" />
    <el-table-column prop="nowLogin.loginTime" label="本次登录时间" width="180" />
  </el-table>
</template>
<script  setup>
  // 引入请求的接口
  import * as api from "@/api/users.js"
  import { ref, onBeforeMount } from "vue"
  //日志数据
  let logData = ref([])
  onBeforeMount(async () => {
      try {
          //发起请求获取日志数据
          let res = await api.getLoginLogApi()
          logData.value = res.data.data;
          // console.log(res)
      } catch (e) {
          console.log(e)
      }
  })
</script>
<script>
export default {
    meta: {
      title: 'glsy', 
      name: '管理首页',
      routeName: "welcome",
      icon:"#icon-shouye1"
    }
}
</script>
